﻿// owner 蒋家伟

#pragma once
#include "IWordReader.h"

// duckx
#include "duckx.hpp"

namespace jsdk
{
    class WordReader: public IWordReader
    {
    public:
        ~WordReader();
        static OwnerPtr<WordReader> create();
    private:
        virtual bool openTable(uint64_t tableCount) override;
        virtual bool openDocument(const std::wstring& fileName) override;
        virtual bool getCellData(uint64_t row, uint64_t col, std::wstring& res) override;
        virtual uint64_t getTableCount() override;


        WordReader() {};
    private:
        duckx::Document m_doc{};
        duckx::Table m_currentTable{};
        uint64_t m_tableCounts = 0;
    };
}